#!/usr/bin/env bash
set -e
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
[[ -n $DEBUG ]] && set -x

if [ -n "${ropopath}" ]; then
  export REPOPATH="${repopath}";
else
  export REPOPATH="/root/gpu_tools_repo"
fi

if [ -z "${uninstall}" ]; then
  envsubst < ./manifests/repo-server.yaml | kubectl apply -f -
elif [ -n "${uninstall}" ]; then
  kubectl delete -f ./manifests/repo-server.yaml
fi
